<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" 
%><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" 
%><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" 
%><%@ page contentType="text/html;charset=ISO-8859-1"
%><html:html locale="true">
    <head>
       
        <title><bean:message key="grupo.title"/></title>
        
        <html:base/>
        <script type="text/javascript" src="../js/prototype.js"></script>
        <script type="text/javascript">            
            function prioridad(){
                document.getElementById("prioridad").selectedIndex = ${prioridad};
            }
            
            function formatearRequisitos(){
                var i = 0;
                var j=0;
                var requisitos;
                while(true){
                    if($('r'+i)){
                        requisitos = $('r'+i).innerHTML.split(";");
                        if(requisitos[0] == "false"){
                            $('req'+i).innerHTML = "&nbsp;";
                        }else{
                            asigs = requisitos[0].split(",");
                            a = "";
                            for(j=0;j<asigs.length;j++)
                                a += asigs[j] + "<br>";
                                $('req'+i).innerHTML = a;
                        }

                        if(requisitos[1] == "false")
                            $('pera'+i).innerHTML = "&nbsp;";
                        else
                            $('pera'+i).innerHTML = requisitos[1];
                        
                        if(requisitos[2] == "true")
                            $('perc'+i).innerHTML = "Si";
                        else
                            $('perc'+i).innerHTML = "No";
                        
                        if(requisitos[3] == "false")
                            $('num'+i).innerHTML = "&nbsp;";
                        else
                            $('num'+i).innerHTML = requisitos[3];
                        
                        if(requisitos[4] == "true")
                            $('res'+i).innerHTML = "Si";
                        else
                            $('res'+i).innerHTML = "No";
                        i++;
                    }else{
                        break;   
                    }       
                }
            }
            
        </script>
        <link rel="stylesheet" type="text/css" href="../css/style.css"></link>
<style type="text/css">
div#box30569 {width: 400px; margin: 40px auto; }
form#30569 {float: left; margin: 0; padding: 0; display: inline; width: 400px; }
form#30569 p {float: left; margin: 0; padding: 0; display: inline; }
form#30569 label {float: left; margin: 0; padding: 0; display: inline; overflow: hidden; }
form#30569 input {float: left; margin: 0; padding: 0; display: inline; }
  form#30569 p#30573_C {clear: both; width: 400px; }
  form#30569 p#30573_C label {clear: both; width: 400px; }
  form#30569 p#30573_C input {clear: both; width: 396px; }
  form#30569 p#30574_C {clear: both; width: 400px; }
  form#30569 p#30574_C label {clear: both; width: 400px; }
  form#30569 p#30574_C input {clear: both; width: 396px; }
  form#30569 p#30571_C {clear: both; width: 400px; }
  form#30569 p#30571_C label {clear: both; width: 400px; }
  form#30569 p#30571_C input {clear: both; width: 396px; }
  form#30569 p#30570_C {clear: both; width: 400px; }
  form#30569 p#30570_C label {clear: both; width: 400px; }
  form#30569 p#30570_C input {clear: both; width: 396px; }
  form#30569 p#30572_C {clear: both; width: 400px; }
  form#30569 p#30572_C label {clear: both; width: 400px; }
  form#30569 p#30572_C input {clear: both; width: 396px; }

</style>
    </head>
    <body onload="prioridad();formatearRequisitos();">
        <div id="header">
            <div id="title"><bean:message key="grupo.title"/></div>
            <div id="menu">
                <ul id="nav">
                    <li><html:link action="/GrupoElim.do" paramId="idGrupo" paramName="idGrupo"><bean:message key="grupo.label1"/></html:link></li>
                    <li>&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;</li>
                    <li><html:link action="/GrupoPlanDeEstudiosCrearI.do" paramId="idPlan" paramName="idPlan"><bean:message key="grupo.label2"/></html:link></li>
                    <li>&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;</li>
                    <li><html:link action="/PlanDeEstudiosI.do" paramId="idPlan" paramName="idPlan"><bean:message key="grupo.label3"/></html:link></li>
                    <li>&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;</li>
                    <li><html:link action="/RequisitosGrupoCrearI.do" paramId="idGrupo" paramName="idGrupo"><bean:message key="grupo.label5"/></html:link></li>

                </ul>
            </div>
        </div>
        <div id="body_wrapper">
            <div id="body">
                <div id="split">
                    <div class="top"></div>
                    <div id="left">
                        <div class="content">
                            ${empty msg ? "" : msg}
                <div class="box30569"><html:form styleId="F30569" action="/GrupoAct.do">
                  <html:hidden property="idGrupo"/>
                  <html:hidden value="${idPlan}" property="idPlan"/>
                  <table><tr>
                  <td id="30574_C"><label for="30574"><bean:message key="FGrupo.label1"/></label></td><td>&nbsp;<html:text styleId="30574" property="nombre" size="30"/></td>
                </tr><tr><td id="30571_C"><bean:message key="FGrupo.label2"/></td><td>&nbsp;
                     <select name="prioridad" id="prioridad">
                       <option value="0">Alta
                       <option value="1">Media-Alta
                       <option value="2">Media
                       <option value="3">Media-Baja
                       <option value="4">Baja
                    </select>
              </td></tr></table>
                  <html:submit styleClass="button"><bean:message key="grupo.label0"/></html:submit>
                </html:form></div>
                <h2><bean:message key="grupo.label4"/></h2>
                <table border="1">
                    <thead>
                        <tr>
                            <th>Asignatura</th>
                            <th>Requisitos</th>
                            <th>Per&iacute;odo aprobado</th>
                            <th>Permiso coordinaci&oacute;n</th>
                            <th>Cr&eacute;ditos aprobados</th>
                            <th>Reserva</th>
                            <!--th>Grupo</th-->

                        </tr>
                    </thead>
                    <tbody><% request.setAttribute("_vacio", new Object[0]); int c = 0;%>
                        <logic:iterate id="requisitos" collection="${empty L_Requisitos ? _vacio : L_Requisitos}">
                            <tr>
                                <td>
                                    <html:link action="/RequisitosI.do" paramId="idRequisito" paramName="requisitos" paramProperty="idRequisito" title="${requisitos.asignatura.nombre}">${requisitos.asignatura.codigo}</html:link>
                                    <div id="r<%=c%>" style="display:none">${requisitos.requisitos}</div>
                                </td>
                                <td align="center" id="req<%=c%>"></td>
                                <td align="center" id="pera<%=c%>"></td>
                                <td align="center" id="perc<%=c%>"></td>
                                <td align="center" id="num<%=c%>"></td>
                                <td align="center" id="res<%=c++%>"></td>
                                <!--td>${empty requisitos.grupo ? "" : requisitos.grupo.nombre}</td-->
                            </tr>
                        </logic:iterate>
                    </tbody>
                </table>

                        </div>
                    </div>
                    <div id="right"><jsp:include page="/ppal/menu.jsp" flush="true"/></div>
                    <div class="clearer"></div>
                    <div class="bottom"></div>
                </div>
                <div class="clearer"></div>
            </div>
            <div class="clearer"></div>
        </div>
        <div id="end_body"></div>
        <h3 class="title"></h3>
        <div id="footer"> <bean:message key="bottom.label"/> </div>
        
    </body>
</html:html>